import React from 'react'
import ReactDOM from 'react-dom'

// function Welcome(props) {
//   return <h1>hello { props.name }</h1>
// }
/*================上下两种写法相等=================*/
class Welcome extends React.Component {
  render() {
    return <h1>hello { this.props.name }</h1>
  }
}

// function App() {
//   return (
//     <div>
//       <Welcome name="张三" />
//       <Welcome name="李四" />
//       <Welcome name="王五" />
//     </div>
//   )
// }
/*================上下两种写法相等=================*/
class App extends React.Component {
  render() {
    return (
      <div>
        <Welcome name="张三" />
        <Welcome name="李四" />
        <Welcome name="王五" />
      </div>
    )
  }
}

ReactDOM.render(
  <App />,
  document.getElementById('root')
)